package acn.spring.domain;

import javax.persistence.Embedded;
import javax.persistence.Entity;

import org.hibernate.validator.constraints.NotBlank;

@Entity
public class Customer extends User {

	/**
	 * 
	 */
	private static final long serialVersionUID = 857626234841727516L;

	@NotBlank
	private String firstname;

	@NotBlank
	private String lastname;

	@Embedded
	private Address address;

	public String getRole() {
		return "Customer";
	}

	public Address getAddress() {
		if (address == null) {
			address = new Address();
		}
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

}
